﻿//using Microsoft.Extensions.DependencyInjection;
//using Microsoft.Extensions.Logging;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Reflection;
//using System.Text;
//using System.Threading.Tasks;

//namespace Manon.Core.IOC
//{
//    public static class Resolver
//    {
//        static Resolver()
//        {
//            Current = null;
//        }

//        public static IServiceProvider Current { get; set; }

//        public static void SetDependencyResolver(IServiceCollection services)
//        { 
//            Current = services.BuildServiceProvider(); 
//        }


//        public static T GetService<T>()
//        {  
//            if (Current == null) throw new ResolverException(typeof(T));

//            var service =  (T)Current.GetService<T>();
//            if (service == null)
//            { 
//                throw new ResolverException(typeof(T));
//            }
//            return service;
//        }
//    }
//}
